<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //同步回调
        // let arr = [1,2,3];
        // let newArr = arr.map(item => {
        //     console.log('hello');
        //     return item * 10;
        // });
        // console.log(newArr);

        //异步回调
        //1. 定时器
        // setTimeout(() => {
        //     console.log(111);
        // }, 1000);

        // console.log(222);
        //2. 事件回调
        // a.onclick = function(){
        //     console.log(111);
        // }
        // console.log(222);

        //3. AJAX
        // xhr.onreadystatechange = function(){

        // }

        //4. fs 模块
        fs.readFile('./index.html', (err,data) => {

        })

    </script>
</body>
</html>